#include "Engine/Program.h"


namespace tyro
{
	namespace Engine
	{

		Program::Program(Engine& engine)
			: engine(engine)
		{
		}


		Program::~Program()
		{
		}

		void Program::Update()
		{
		}

		bool Program::Run()
		{
			running = true;

			if(!Initialise())
				return 0;

			while(running)
			{
				FLOAT_32 time = engine.GetTimeStep();



				time = min(time, 0.1f);
				time_to_next_step_ = time;
				timestep = time;


				if( !engine.Update(time) )
				{
					running = false;
				}

				Update();

				Render();

			}

			return true;
		}
	}
}